#ifndef VARIABLENODE_H
#define VARIABLENODE_H

#include "Common\Node.h"

namespace CExpression
{
	class VariableNode:public Node
	{
	public:
		VariableNode():variableName(),currentType(ExecuteRunTimeType::None){}

		VariableNode(const ExpressionString &name,ExecuteRunTimeType type):variableName(name),currentType(type){}

		const ExpressionString& VariableName() const
		{
			return this->variableName;
		}

		void SetVariableName(const ExpressionString &val)
		{
			this->variableName=val;
		}

		ExecuteRunTimeType CurrentType() const
		{
			return this->currentType;
		}

		void SetCurrentType(ExecuteRunTimeType val)
		{
			this->currentType=val;
		}

		virtual void Eval(ExecuteContext &context);
		virtual std::shared_ptr<Node> Clone(Expression &parent);
	private:
		ExpressionString variableName;
		ExecuteRunTimeType currentType;
	};
}
#endif